Skip to content

add Lite profile examples#91

Open
NorioKobota wants to merge 56 commits into
spdx:masterfrom
NorioKobota:lite-profile
Open

add Lite profile examples#91
NorioKobota wants to merge 56 commits into
spdx:masterfrom
NorioKobota:lite-profile

Conversation

@NorioKobota

Copy link
Copy Markdown

We implemented three samples that show how to use Lite Profile.
We would appriciate your review.

no-ta added 3 commits July 1, 2024 21:28
Signed-off-by: notanaka <No.Tanaka@sony.com>
Signed-off-by: Nobuyuki Tanaka <No.Tanaka@sony.com>

@JPEWdev JPEWdev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CI with likely find many more problems once it runs. I'll admit that the output of the checks, while very through, can be difficult to interpret. If you run into trouble getting these to pass CI, let me know and I can help interpret the errors.

Overall, the structure of these documents seems fine, they just need to conform to the JSON schema and SHACL model (which is done by CI) and they should be OK

@@ -0,0 +1,189 @@
{
"@context": "https://raw.githubusercontent.com/spdx/spdx-3-serialization-prototype-playground/main/jsonld/spdx-3.0-context.json-ld",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the example context URL, the actual URL needs to be used now, which is:

"@context": "https://spdx.github.io/spdx-spec/v3.0/model/spdx-context.jsonld"

"@graph": [
{
"type": "SpdxDocument",
"spdxId": "http://spdx.example.com/Document/1",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

http://spdx.example.com/Document/1 is not a good example spdxId. An SPDX ID needs some universally unique identifier, and SPDX has a defined URL prefix of https://spdx.org/spdxdocs/ for the case where the producer doesn't have their own domain. Thus, your spdx ID should probably look something like:

"spdxId": "https://spdx.org/spdxdocs/08f113e9-a0b0-4482-a0ed-c4e18e5136be/Document/1"

The https://spdx.org/spdxdocs/08f113e9-a0b0-4482-a0ed-c4e18e5136be/ prefix can be reused for all the other objects in this document keeping the existing scheme of appending the type and an index if you desire.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See "Best practices for creating spdxIds for SPDX documents (and their Elements)" at https://spdx.github.io/spdx-spec/v3.1-dev/model/Core/Properties/spdxId/ (borrowed from SPDX 2.x and to be in SPDX 3.1)

Comment thread lite/example1-with-VEX/Lite-example-1-1-with-VEX.jsonld Outdated
"type": "NamespaceMap",
"prefix": "lite-example",
"namespace": "http://spdx.example.com/Lite/1"
}],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This namespace map is not used in the document, so please remove it for clarity

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pattern still exists in

  • lite/example1-with-VEX/spdx3.0/Lite-example-1-1-with-VEX.spdx.json
  • lite/example1-with-VEX/spdx3.0/Lite-example-1-3-with-VEX.spdx.json

Comment thread lite/example1-with-VEX/Lite-example-1-1-with-VEX.jsonld Outdated
"http://spdx.example.com/Relationship/2",
"http://spdx.example.com/Relationship/3"
],
"sbomType": "build"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Property names are always prefix by their namespace (e.g. profile) unless they are from core, so this needs to be:

"software_sbomType": [ "build" ],

Also be aware that SPDX 3.0 JSON doesn't allow array eliding, so if a property has any max ordinality other than 1, it must be an array in JSON, even if it only contains one item.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of these are fixed but there are still 3 instances of "software_sbomType" that is not an array.

Comment thread lite/example1-with-VEX/Lite-example-1-1-with-VEX.jsonld Outdated
Comment thread lite/example1-with-VEX/Lite-example-1-1-with-VEX.jsonld Outdated
no-ta added 16 commits July 10, 2024 17:46
Signed-off-by: Nobuyuki Tanaka <No.Tanaka@sony.com>
Signed-off-by: Nobuyuki Tanaka <No.Tanaka@sony.com>
Signed-off-by: Nobuyuki Tanaka <No.Tanaka@sony.com>
Signed-off-by: Nobuyuki Tanaka <No.Tanaka@sony.com>
Signed-off-by: Nobuyuki Tanaka <No.Tanaka@sony.com>
Signed-off-by: Nobuyuki Tanaka <No.Tanaka@sony.com>
Signed-off-by: Nobuyuki Tanaka <No.Tanaka@sony.com>
Signed-off-by: Nobuyuki Tanaka <No.Tanaka@sony.com>
Signed-off-by: Norio Kobota <norio.kobota@sony.com>
Signed-off-by: Norio Kobota <norio.kobota@sony.com>


Signed-off-by: Norio Kobota <norio.kobota@sony.com>
Signed-off-by: Norio Kobota <norio.kobota@sony.com>
NorioKobota and others added 3 commits July 20, 2024 22:24
Signed-off-by: Norio Kobota <norio.kobota@sony.com>
Signed-off-by: Nobuyuki Tanaka <No.Tanaka@sony.com>
@kestewart kestewart requested a review from JPEWdev August 20, 2024 16:13
bact

This comment was marked as resolved.

NorioKobota and others added 5 commits January 9, 2025 18:49
….json

Co-authored-by: Arthit Suriyawongkul <arthit@gmail.com>
Signed-off-by: Norio Kobota <norio.kobota@sony.com>
….json

Co-authored-by: Arthit Suriyawongkul <arthit@gmail.com>
Signed-off-by: Norio Kobota <norio.kobota@sony.com>
….json

Co-authored-by: Arthit Suriyawongkul <arthit@gmail.com>
Signed-off-by: Norio Kobota <norio.kobota@sony.com>
Co-authored-by: Arthit Suriyawongkul <arthit@gmail.com>
Signed-off-by: Norio Kobota <norio.kobota@sony.com>
Co-authored-by: Arthit Suriyawongkul <arthit@gmail.com>
Signed-off-by: Norio Kobota <norio.kobota@sony.com>
@bact

bact commented Jan 9, 2025

Copy link
Copy Markdown
Collaborator

@NorioKobota do you mind to move all SPDX JSON files from spdx-3.0/ folder to spdx3.0/ folder please? Thank you

The current workflow is now looking for files in spdx3.0/ (to make is consistent with previous spdx2.0/).

for f in $(find . -type f -path '*/spdx3.0/*.json'); do

@NorioKobota

Copy link
Copy Markdown
Author

@bact Sure.
I will do it and the rest of the change request. Sorry for the late reply.
Thanks!

Comment thread lite/example2/spdx-3.0/lite-example-2.spdx.json Outdated
Comment thread lite/example1-with-VEX/spdx-3.0/Lite-example-1-1-with-VEX.spdx.json Outdated
Comment thread lite/example1-with-VEX/spdx-3.0/Lite-example-1-2-with-VEX.spdx.json Outdated
Comment thread lite/example1-with-VEX/spdx-3.0/Lite-example-1-3-with-VEX.spdx.json Outdated
json and png: amends of relationshipType in VEX relationship is modified to amendedBy to meet specification
Signed-off-by: Norio Kobota <norio.kobota@sony.com>
@NorioKobota

Copy link
Copy Markdown
Author

@bact
I believe I have fixed everything except dataLicense, could you please review it?
Also, is there an example of how to write dataLicense somewhere?

@bact bact left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. Few minor changes suggested. After this I think we are good to go.

NorioKobota and others added 3 commits January 28, 2025 16:51
Co-authored-by: Arthit Suriyawongkul <arthit@gmail.com>
Signed-off-by: Norio Kobota <norio.kobota@sony.com>
Co-authored-by: Arthit Suriyawongkul <arthit@gmail.com>
Signed-off-by: Norio Kobota <norio.kobota@sony.com>
Co-authored-by: Arthit Suriyawongkul <arthit@gmail.com>
Signed-off-by: Norio Kobota <norio.kobota@sony.com>
@NorioKobota

Copy link
Copy Markdown
Author

Thank you so much for the review.
I confirmed and committed your suggestions.

@bact

bact commented Jan 28, 2025

Copy link
Copy Markdown
Collaborator

Thank you @NorioKobota and @no-ta . I think it's pretty much all good.

Now we need a maintainer to approve the validation workflow - to let it pass the validation before merge.

(Note that I have removed all my suggestions that are already resolved, since they are too long, to make this PR easier to read)

@bact

bact commented Jan 28, 2025

Copy link
Copy Markdown
Collaborator

@zvr @goneall if you have some time to approve the workflow (for PR validation ), thank you.

@NorioKobota

Copy link
Copy Markdown
Author

@bact Ah, sorry.
#91 (comment)
I believe I have fixed everything **except dataLicense**.
Could someone teach me how to implement?

@bact

bact commented Jul 22, 2025

Copy link
Copy Markdown
Collaborator

As there were changes in validation workflow/dependencies in April 2025 (and probably also after that), we may like to rerun the check to see if it pass now.

@bobmartin3000 bobmartin3000 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bact bact left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

software_sbomType has to be an array

"https://spdx.org/spdxdocs/08f113e9-a0b0-4482-a0ed-c4e18e5136be/Relationship/2",
"https://spdx.org/spdxdocs/08f113e9-a0b0-4482-a0ed-c4e18e5136be/Relationship/3"
],
"software_sbomType": "build"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"software_sbomType": "build"
"software_sbomType": [
"build"
]

"https://spdx.org/spdxdocs/08f113e9-a0b0-4482-a0ed-c4e18e5136be/Relationship/2",
"https://spdx.org/spdxdocs/08f113e9-a0b0-4482-a0ed-c4e18e5136be/Relationship/3"
],
"software_sbomType": "build"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"software_sbomType": "build"
"software_sbomType": [
"build"
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants